<?php
class appBasicModule extends Module {
	
	/*
	 * 在构造函数中装载所依赖的类或其他文件
	*/
	function __construct() {
		$this->includePhp('appBasic', 'appBasic');
	}
	
	/*
	 * 调用插件资源
	*/
	public function call($user, $method, $param) {
		switch ($method) {
			case 'spalashInfo':
			    $id = $param->id;
				return appBasic::spalashInfo($id);
            case 'newUpgradeInfo':
                return appBasic::newUpgradeInfo($param);
            case 'addDailyLive':
	            $cuid = $param->cuid;
	            $IMEI = $param->IMEI;
	            $mobilePhoneNumber = $param->mobilePhoneNumber;
	            $appPhoneNumber = $param->appPhoneNumber;
	            $systemUseTime = $param->systemUseTime;
	            $appUseTime = $param->appUseTime;
	            $day = $param->day;
                return appBasic::addDailyLive($cuid,$IMEI,$mobilePhoneNumber,$appPhoneNumber,$systemUseTime,$appUseTime,$day);
            case 'downloadApp':
                return appBasic::downloadApp($param);
            case 'saveRegistrationID':
            	$uid = $param->uid;
	            $registrationID = $param->registrationID;
	            $accessToken = $param->accessToken;
	            if (!isset($uid) || !isset($registrationID) || !isset($accessToken)) {
                    Output::instance()->resultCode(code_lackof_param);
                    return;
                }
            	return appBasic::saveRegistrationID($uid,$registrationID,$accessToken);
		}
	}
}


$module = new appBasicModule();
Module::addModule($module);